﻿@using CuongHanh.Context
@using CuongHanh.Models
@{
    List<OrderDetailForGem> items = CartAndPaymentContext.GetBagInfoOfGem(Session);
    long subTotal = 0;
    int index = 0;
}
<table width="92%" border="0" cellpadding="0" cellspacing="0" class="cart">
    <tr>
        <th width="12%" align="left" scope="col">@Html.GetResource("cartitem")</th>
        <th class="item1" width="23%" scope="col">&nbsp;</th>
        <th width="18%" align="right" scope="col">@(Html.GetResource("total")) (VND)</th>
    </tr>
    @foreach (OrderDetailForGem item in items)
    {
        index++;
        subTotal += item.GetTotalPrice;
        <tr>
            <td><a class="bg_img" href="javascript:void(0);"><img src="@Url.Action("GetImageFromData",
                                                                               "Gem",
                                                                               new
                                                                               {
                                                                                       parentStyleId = item.ParentStyleId,
                                                                                       parentMaterialId = item.ParentMaterialId,
                                                                                       parentStoneId = item.ParentStoneId,
                                                                                       childStyleId = item.ChildStyleId,
                                                                                       childMaterialId = item.ChildMaterialId,
                                                                                       childStoneId = item.ChildStoneId,
                                                                                       isThumnail = true
                                                                               })" width="70" height="69" /></a></td>
            <td align="center" id="item-price-@index" ref="@(item.GetPrice)">@(Html.GetResource("price")): @(item.GetPrice.FormatNumber())
                <br/>
                @(Html.GetResource("quantity")): @item.Count
            </td>
            <td align="right"><span id="item-total-price-@index" class="quality">@(item.GetTotalPrice.FormatNumber())<a class="up"></a><a class="down"></a></span></td>
        </tr>
    }
    <tr class="noline">
        <td colspan="2" align="right"><p class="cart_note">SUBTOTAL (1 item)</p>
        <td align="right">@subTotal.FormatNumber()</td>
    </tr>
    <tr class="noline">
        <td colspan="2" class="blue" align="right">@Html.GetResource("shippingcost")
        <td align="right" id="shipping-cost">0</td>
    </tr>
    <tr class="noline">
        <td colspan="2" class="blue" align="right">@Html.GetResource("utilityfee")
        <td align="right" id="utility-fee">0</td>
    </tr>

   

    <tr>
        <td colspan="2" align="right" class="sum"><span class="cart_note"><strong>@Html.GetResource("total")</strong></span>    
        <td align="right" class="sum"><strong id="total-price">@subTotal.FormatNumber()</strong></td>
    </tr>
</table>

<input type="hidden" id="sub-total-price" value="@subTotal"/>